#!/bin/bash
###
# @Author: Logan.Li
# @Gitee: https://gitee.com/attacker
# @email: admin@attacker.club
# @Date: 2023-08-22 18:45:08
# @LastEditTime: 2023-08-23 10:04:23
# @Description:
###

# List of IPv4 addresses
ipv4_addresses=(
    "116.206.192.14"
    "114.130.157.141"
    "103.137.160.116"
    "39.37.34.39"
    "103.155.70.42"
    "103.25.251.238"
    "103.141.201.234"
    "103.25.249.251"
    "42.0.7.236"
    "103.25.249.254"
    "103.25.248.233"
    "103.25.250.231"
    "103.25.250.253"
    "202.86.218.73"
    "43.245.140.174"
    "103.106.239.73"
    "103.70.171.147"
    "39.52.222.90"
    "103.127.56.106"
    "103.116.91.201"
    "103.158.86.238"
    "103.25.249.245"
    "103.25.251.227"
    "103.50.82.209"
    "114.130.156.220"
    "103.25.248.232"
    "118.179.187.182"
    "103.76.241.222"
    "202.94.164.162"
    "37.111.247.180"
    "103.103.88.200"
    "103.114.23.106"
    "103.147.163.93"
    "103.25.248.231"
    "103.25.248.249"
    "103.25.249.228"
    "103.25.250.236"
    "103.25.250.250"
    "103.25.251.233"
    "118.179.106.65"
    "118.179.39.33"
    "160.238.0.197"
    "202.86.216.36"
    "202.86.218.17"
    "27.147.202.204"
    "43.245.143.62"
    "43.245.143.98"
    "103.109.56.230"
    "103.189.69.40"
    "103.210.57.194"
    "103.214.201.106"
    "103.229.82.146"
    "103.25.248.238"
    "103.25.248.243"
    "103.25.248.246"
    "103.25.249.236"
    "103.25.250.235"
    "103.25.250.247"
    "103.25.250.248"
    "103.25.251.226"
    "103.25.251.230"
    "103.31.155.229"
    "103.48.160.56"
    "118.179.30.23"
    "202.134.8.128"
    "27.147.191.93"
    "37.111.129.203"
    "37.111.134.160"
    "37.111.175.170"
    "42.0.7.233"
    "58.145.190.248"
    "103.108.113.118"
    "103.118.77.41"
    "103.122.90.13"
    "103.145.113.66"
    "103.159.128.82"
    "103.213.236.38"
    "103.25.248.236"
    "103.25.248.254"
    "103.25.249.225"
    "103.25.249.231"
    "103.25.249.241"
    "103.25.249.244"
    "103.25.250.226"
    "103.25.250.228"
    "103.25.250.229"
    "103.25.250.232"
    "103.25.250.233"
    "103.25.250.240"
    "103.25.250.252"
    "103.25.251.225"
    "103.25.251.244"
    "103.25.251.254"
    "103.68.118.20"
    "106.0.53.113"
    "108.181.27.238"
    "119.148.29.248"
    "154.198.110.41"
    "202.94.164.254"
    "223.123.12.86"
    "42.0.7.240"
    "103.112.206.47"
    "103.112.55.199"
    "103.118.77.23"
    "103.166.58.188"
    "103.173.175.20"
    "103.190.82.214"
    "103.210.57.195"
    "103.218.24.12"
    "103.239.253.193"
    "103.248.94.120"
    "103.25.248.226"
    "103.25.248.234"
    "103.25.248.237"
    "103.25.248.239"
    "103.25.248.240"
    "103.25.248.251"
    "103.25.248.253"
    "103.25.249.234"
    "103.25.249.239"
    "103.25.249.242"
    "103.25.249.246"
    "103.25.249.247"
    "103.25.250.227"
    "103.25.250.230"
    "103.25.250.234"
    "103.25.251.234"
    "103.25.251.249"
    "103.48.160.232"
    "103.77.107.142"
    "202.134.8.131"
    "36.255.45.150"
    "37.111.216.189"
    "42.0.7.226"
    "42.0.7.234"
    "42.0.7.237"
    "42.0.7.245"
    "42.0.7.247"
    "103.115.101.13"
    "103.120.203.196"
    "103.134.1.154"
    "103.137.74.135"
    "103.147.162.179"
    "103.156.238.6"
    "103.159.128.83"
    "103.16.226.226"
    "103.16.25.167"
    "103.198.133.109"
    "103.23.206.243"
    "103.230.104.22"
    "103.230.105.30"
    "103.25.248.129"
    "103.25.248.241"
    "103.25.248.245"
    "103.25.248.247"
    "103.25.249.235"
    "103.25.249.238"
    "103.25.249.250"
    "103.25.250.237"
    "103.25.250.238"
    "103.25.250.241"
    "103.25.250.242"
    "103.25.250.254"
    "103.25.251.242"
    "103.25.251.252"
    "103.31.155.246"
    "103.31.155.248"
    "103.76.241.114"
    "103.91.52.6"
    "118.179.165.241"
    "202.134.14.147"
    "202.134.8.133"
    "202.134.8.143"
    "202.86.218.246"
    "209.38.251.13"
    "223.123.4.209"
    "27.147.191.33"
    "39.34.138.198"
    "42.0.6.240"
    "42.0.7.251"
    "42.0.7.252"
    "58.145.184.229"
    "58.145.189.234"
    "103.102.138.138"
    "103.107.77.204"
    "103.111.123.110"
    "103.112.55.52"
    "103.118.77.109"
    "103.118.78.128"
    "103.118.78.222"
    "103.119.23.126"
    "103.120.167.25"
    "103.120.203.109"
    "103.120.34.65"
    "103.127.0.210"
    "103.139.9.161"
    "103.143.139.240"
    "103.147.162.71"
    "103.151.11.204"
    "103.16.25.182"
    "103.216.57.246"
    "103.23.206.248"
    "103.230.107.53"
    "103.242.23.180"
    "103.242.23.184"
    "103.25.248.227"
    "103.25.248.230"
    "103.25.248.235"
    "103.25.248.248"
    "103.25.248.252"
    "103.25.249.237"
    "103.25.249.249"
    "103.25.249.252"
    "103.25.250.239"
    "103.25.250.243"
    "103.25.250.245"
    "103.25.250.249"
    "103.25.251.237"
    "103.25.251.240"
    "103.25.251.243"
    "103.25.251.251"
    "103.35.177.31"
    "103.48.160.28"
    "103.67.159.226"
    "103.67.159.92"
    "103.85.238.101"
    "103.89.241.129"
    "110.226.75.247"
    "113.203.217.50"
    "113.21.229.114"
    "114.130.152.206"
    "114.130.188.241"
    "117.209.42.61"
    "118.179.49.41"
    "128.1.186.146"
    "154.80.119.20"
    "180.149.232.168"
    "185.185.132.103"
    "194.5.215.159"
    "202.134.10.130"
    "202.134.10.134"
    "202.134.10.135"
    "202.134.10.142"
    "202.134.14.129"
    "202.134.14.133"
    "202.134.8.141"
    "202.86.216.174"
    "202.86.217.220"
    "27.147.176.156"
    "27.147.186.234"
    "27.34.254.117"
    "37.111.205.53"
    "37.111.218.41"
    "37.111.223.129"
    "37.111.223.83"
    "42.0.6.248"
    "42.0.7.225"
    "42.0.7.228"
    "42.0.7.230"
    "42.0.7.235"
    "42.0.7.241"
    "42.0.7.249"
    "42.0.7.250"
    "42.0.7.254"
    "43.245.120.214"
    "45.118.244.20"
    "5.62.61.111"
    "50.7.253.133"
    "51.15.117.26"
    "51.158.173.127"

)

# Add DROP rule for each IPv4 address
for ip in "${ipv4_addresses[@]}"; do
    iptables -A INPUT -s "$ip" -j DROP
    # iptables -D INPUT -s "$ip" -j DROP # 删除新增的策略
done

# Save iptables rules
service iptables save
